<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function A() {
            this.c = 1
            return {
                a: 1,
                b: 2
            }
        }

        let a1 = A()
        let a2 = new A()
        let a3 = new A //在js中，如果构造函数没参数括号可以省，所以a2和a3一样

        console.log(a1, a2, a3)

        // 结果三个都是 {a: 1, b: 2}
    </script>
</body>

</html>